<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/6/28
 * Time: 15:39
 */

namespace App\Http\Controllers\Api;

use App\Services\NotesService;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Lib\Util\ResponseUtil;
use Illuminate\Support\Facades\Schema;

class NotesController extends Controller
{
    private $baseNotesService = null;

    public function __construct(NotesService $baseNotesService)
    {
        $this->baseNotesService = $baseNotesService;
    }

    public function getNotesList(Request $request)
    {
        $uid = $request->uid;
        $info = $this->baseNotesService->getNotesList($uid);
        return   ResponseUtil::jsonResponse(true,0,'',$info);
    }

    public function getNotesDetail(Request $request)
    {
        $uid = $request->uid;
        $id = $request->id;
        $info = $this->baseNotesService->getNotesDetail($uid,$id)[0];
        return   ResponseUtil::jsonResponse(true,0,'',$info);
    }

}